<include file="header"/>
<body class="bg-grey">
<div class="wraper margin-b">
    <if condition="!empty($recordData)">
        <volist name="recordData" id="vo">
            <input type="hidden" value="{BEESCRM:$vo.id}" id="isId">
            <div class="lists block-top">
                <a href="#" class="tb-mode border-btm">
                    <div class="tb-cell">
                        <p>{BEESCRM:$vo.real_name} <span class="text-12 text-grey">预约人</span></p>
                        <p class="text-12">预约时段：{BEESCRM:$vo.start_time|date="Y-m-d",###}至{BEESCRM:$vo.end_time|date="Y-m-d",###}</p>
                        <p class="text-12">病情描述：{BEESCRM:$vo.summary}</p>
                    </div>
                    <div class="tb-cell status text-right">
                        <span class="{BEESCRM:$getTextColor[$vo['status']]}">{BEESCRM:$getOrderStatus[$vo['status']]}</span>
                        <span class="iconfont icon-you"></span>
                    </div>
                </a>
                <p class="text-right">
                    <a href="/Park/hkeeper/orderdetails/conf_id/1/id/{BEESCRM:$vo.id}" class="list-btn">查看详情</a>
                    <if condition="$vo.status eq 0"><a href="#" class="list-btn btn-blue" name="pass">确认接单</a>
                        <else/>
                    </if>
                </p>
            </div>
        </volist>
    <else/>
        <div class="none-list"><img src="/assets/base/cleaning/images/none-list.png"/></div>
    </if>
    <!--<div class="lists block-top">
        <a href="#" class="tb-mode border-btm">
            <div class="tb-cell">
                <p>陈默宇 <span class="text-12 text-grey">预约人</span></p>
                <p class="text-12">预约时段：2016-02-02至2016-03-02</p>
                <p class="text-12">病情描述：老人需要照顾饮食</p>
            </div>
            <div class="tb-cell status text-right">
                <span class="text-red">待确认</span>
                <span class="iconfont icon-you"></span>
            </div>
        </a>
        <p class="text-right">
            <a href="#" class="list-btn">查看详情</a>
            <a href="#" class="list-btn btn-blue">确认接单</a>
        </p>
    </div>
    <div class="lists block-top">
        <a href="#" class="tb-mode border-btm">
            <div class="tb-cell">
                <p>陈默宇 <span class="text-12 text-grey">预约人</span></p>
                <p class="text-12">预约时段：2016-02-02至2016-03-02</p>
                <p class="text-12">病情描述：老人需要照顾饮食</p>
            </div>
            <div class="tb-cell status text-right">
                <span class="text-green">进行中</span>
                <span class="iconfont icon-you"></span>
            </div>
        </a>
        <p class="text-right">
            <a href="#" class="list-btn">查看详情</a>
        </p>
    </div>
    <div class="lists block-top">
        <a href="#" class="tb-mode border-btm">
            <div class="tb-cell">
                <p>陈默宇 <span class="text-12 text-grey">预约人</span></p>
                <p class="text-12">预约时段：2016-02-02至2016-03-02</p>
                <p class="text-12">病情描述：老人需要照顾饮食</p>
            </div>
            <div class="tb-cell status text-right">
                <span class="text-yellow">待评价</span>
                <span class="iconfont icon-you"></span>
            </div>
        </a>
        <p class="text-right">
            <a href="#" class="list-btn">查看详情</a>
        </p>
    </div>
    <div class="lists block-top">
        <a href="#" class="tb-mode border-btm">
            <div class="tb-cell">
                <p>陈默宇 <span class="text-12 text-grey">预约人</span></p>
                <p class="text-12">预约时段：2016-02-02至2016-03-02</p>
                <p class="text-12">病情描述：老人需要照顾饮食</p>
            </div>
            <div class="tb-cell status text-right">
                <span class="text-blue">已完成</span>
                <span class="iconfont icon-you"></span>
            </div>
        </a>
        <p class="text-right">
            <a href="#" class="list-btn">查看详情</a>
        </p>
    </div>
    <div class="lists block-top">
        <a href="#" class="tb-mode border-btm">
            <div class="tb-cell">
                <p>陈默宇 <span class="text-12 text-grey">预约人</span></p>
                <p class="text-12">预约时段：2016-02-02至2016-03-02</p>
                <p class="text-12">病情描述：老人需要照顾饮食</p>
            </div>
            <div class="tb-cell status text-right">
                <span class="text-grey">已取消</span>
                <span class="iconfont icon-you"></span>
            </div>
        </a>
        <p class="text-right">
            <a href="#" class="list-btn">查看详情</a>
        </p>
    </div>-->
    <div class="fixed-btn-box">
        <a href="/Park/hkeeper/myreservationlist/conf_id/1" class="visited" name="myUser">我的陪护</a>
        <a href="/Park/hkeeper/personalcenter/conf_id/1" name="myUser">个人中心</a>
    </div>
</div>
<div class="pop-box" id="getEndEscort">
    <div class="main">
        <p class="iconfont icon-shenheshibai"></p>
        <div class="main-text">
            <p class="stress text-center">您确定要接单吗？</p>
            <div class="btn-box clearfix">
                <a href="#" class="text-btn" id="isCancel">取消</a>
                <a href="#" class="text-btn" id="isConfirm">确定</a>
            </div>
        </div>
    </div>
</div>
<div class="pop-box" id="pop-box">
    <div class="main">
        <p class="iconfont icon-shenheshibai"></p>
        <div class="main-text">
            <p class="text-center">请耐心等待审核</p>
        </div>
    </div>
</div>
<script src="/assets/park/huser/js/jquery-2.1.0.min.js"></script>
<script src="/assets/park/huser/js/date.js"></script>
<script src="/assets/park/huser/js/iscroll.js"></script>
<script>
    $('#beginTime').date();
    $('#endTime').date();

    $("a[name=myUser]").on('click',function(){
        $("a[name=myUser]").removeClass("visited");
        $(this).addClass("visited");
    });

    $("a[name=pass]").on('click',function(){
            $("#getEndEscort").show();
    });
    $("#isCancel").on('click',function(){
        $("#getEndEscort").hide();
    });

    $("#isConfirm").on('click',function(){
        var id = $("#isId").val();
        $.ajax({
            url:'/Park/hkeeper/orderTakers/conf_id/1',
            type:'POST',
            dataType:'json',
            data:{id:id,token:1},
            success:function(data){
                if(data.err_code == 200){
                    $('#getEndEscort').hide();
                    $("#pop-box").show();
                    $("#pop-box").find('.text-center').text(data.message);
                    setTimeout('setHide()',2000);
                }else{
                    $("#pop-box").find('.text-center').text(data.message);
                    $("#pop-box").show();
                    setTimeout('setHide()',2000);
                }
            }
        });
    });

    function setHide()
    {
        $('#getEndEscort').hide();
        $("#pop-box").hide();
        reload();
    }

    //页面刷新
    function reload(){
        setTimeout('location.reload()',10);
    }
</script>
</body>
</html>
